'''初识threading多线程案例'''
import time
import threading

def sing():
    while True:
        print('我在唱歌....\n')
        time.sleep(1)

def dance(msg):
    while True:
        print(msg)
        time.sleep(1)

if __name__ == '__main__':

    # 创建一个唱歌的线程
    sing_thread = threading.Thread(target=sing)
    # 创建一个跳舞的线程
    # dance_thread = threading.Thread(target=dance)
    # 线程传参 也可使用 args=("我要跳舞，我的主场。。。")
    dance_thread = threading.Thread(target=dance, kwargs={"msg":"我要跳舞，我的主场。。。"})
    # 线程开始执行
    sing_thread.start()
    dance_thread.start()

    # print("asdf")
    # print("asdfxxx")
